import request from '@/utils/request'
// 列表渲染
export function getClassAPI(data) {
  return request({
    url: '/class/class',
    method: 'get',
    params: data
  })
}
export const subjectListApi = () => request({
  url: '/subject/tree'
})
// 获取下拉框
export function getTreeAPI() {
  return request({
    url: '/subject/tree',
    method: 'get'
  })
}
// 讲师，助教，班任
export function getTeachers(params) {
  return request({
    url: '/class/teacher?role_name=' + params.role_name,
    method: 'get'
  })
}

export function getSubject() {
  return request({
    url: '/subject/tree',
    method: 'get'
  })
}

// 添加
export function addClassAPI(data) {
  return request({
    url: '/class/class',
    method: 'post',
    data
  })
}
// 编辑
export const eritclass = (data) => request({
  method: 'PUT',
  url: `/class/class/${data.id}`,
  data
})
// 删除
export const delClass = (id) => request({
  method: 'DELETE',
  url: `/class/class/${id}`
})
// 4. 详情
export const getClass = id => request({
  method: 'GET',
  url: `/class/class/${id}`
})
